import 'dart:ui';

import 'package:flutter/material.dart';


class BotttomClipper extends CustomClipper<Path>{
  @override
  Path getClip(Size size) {
    var path = Path();
    double _height = size.height/8;

    var startPoint1 = Offset(0, size.height);
    var controlPoint1 = Offset(size.width / 12, _height);
    var controlPoint2 = Offset(3 * size.width / 12, _height);
    var endPoint1 = Offset(size.width/3, size.height);
    
    path.moveTo(startPoint1.dx, startPoint1.dy);
    path.cubicTo(
      controlPoint1.dx, 
      controlPoint1.dy,
      controlPoint2.dx, 
      controlPoint2.dy,
      endPoint1.dx,
      endPoint1.dy
    );

    var startPoint2 = Offset(size.width/3, size.height);
    var controlPoint3 = Offset(5*size.width/12, _height);
    var controlPoint4 = Offset(7*size.width/12, _height);
    var endPoint2 = Offset(2*size.width/3, size.height);
    path.moveTo(startPoint2.dx, startPoint2.dy);
    path.cubicTo(
      controlPoint3.dx, 
      controlPoint3.dy,
      controlPoint4.dx, 
      controlPoint4.dy,
      endPoint2.dx,
      endPoint2.dy
    );

    var startPoint3 = Offset(2*size.width/3, size.height);
    var controlPoint5 = Offset(9*size.width/12, _height);
    var controlPoint6 = Offset(11*size.width/12, _height);
    var endPoint3 = Offset(size.width, size.height);
    path.moveTo(startPoint3.dx, startPoint3.dy);
    path.cubicTo(
      controlPoint5.dx, 
      controlPoint5.dy,
      controlPoint6.dx, 
      controlPoint6.dy,
      endPoint3.dx,
      endPoint3.dy
    );

    return path;
  }

  @override
  bool shouldReclip(CustomClipper<Path> oldClipper) {
    return false;
  }
  
}
